from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from aiogram.utils.keyboard import ReplyKeyboardBuilder

COUNTRIES = ["🇬🇧 UK"]
DOCUMENTS_TYPES = ["BILL 🇬🇧"]


def menu_kb(return_as_builder: bool = False):
    builder = ReplyKeyboardBuilder()
    for text in [
        "Создать документ",
        "Личный кабинет",
    ]:
        builder.add(KeyboardButton(text=text))
    builder.adjust(1, 1)

    if return_as_builder:
        return builder

    return builder.as_markup(resize_keyboard=True)


def back_btn():
    return ReplyKeyboardMarkup(
        keyboard=[[KeyboardButton(text="Назад ◀️")]], resize_keyboard=True
    )


def skip_btn():
    return ReplyKeyboardMarkup(
        keyboard=[[KeyboardButton(text="Пропустить")]], resize_keyboard=True
    )


def back_with_skip_btn():
    kb = back_btn()
    kb.keyboard.append([KeyboardButton(text="Пропустить")])
    return kb


def countries_kb():
    builder = ReplyKeyboardBuilder()
    for text in COUNTRIES:
        builder.add(KeyboardButton(text=text))
    builder.add(KeyboardButton(text="Вернуться в меню ◀️"))
    builder.adjust(1, 1)

    return builder.as_markup(resize_keyboard=True)


def document_type_kb():
    builder = ReplyKeyboardBuilder()
    for text in DOCUMENTS_TYPES:
        builder.add(KeyboardButton(text=text))
    builder.add(KeyboardButton(text="Назад ◀️"))
    builder.adjust(1, 1)

    return builder.as_markup(resize_keyboard=True)
